﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace Umbrella.Whs.SharePoint
{
    public sealed class DatabaseManager
    {
        public string SqlServerName
        {
            get
            {
                return (Environment.MachineName + "\\" + Properties.Settings.Default.SqlInstanceName);
            }
        }

        public string ConnectionString
        {
            get
            {
                var b = new SqlConnectionStringBuilder();

                b.ApplicationName = "Umbrella";
                b.DataSource = this.SqlServerName;
                b.IntegratedSecurity = true;
                b.Pooling = true;
                b.ConnectTimeout = (int)Properties.Settings.Default.SqlConnectTimeout.TotalSeconds;

                return b.ConnectionString;
            }
        }

        public DatabaseManager()
        {
            
            
        }
    }
}
